﻿// ------------------------------------------------------------------
// DO NOT REMOVE THIS LINES IN ANY TIMES WILL BE.
// Original author: agehack
// Project name: Putingun
// ------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Putingun
{
    public partial class frmForm : Form
    {
        public frmForm()
        {
            InitializeComponent();
            App.TrayIcon.Text += ' ' + App.VersionMark + "\n" +
                "Putingun Windows";
        }
        private void stat_Click(object sender, EventArgs e)
        {
            App.ToggleMainWindow();
        }
        private void cmd2_Click(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start("http://www.p-v-d.org/");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Ошибка при попытке открытия ссылки", MessageBoxButtons.OK, MessageBoxIcon.Stop);

            }
        }
        private void cmd3_Click(object sender, EventArgs e)
        {
            App.Exit();
        }
        private void cmd4_Click(object sender, EventArgs e)
        {
            App.MainWindow.btnRadioToggle_Click(null, null);
        }
        private void trayContextMenu_Opening(object sender, CancelEventArgs e)
        {
            if (App.MainWindow.IsVisible)
                stat.Text = "Скрыть окно";
            else stat.Text = "Показать окно";
            if (PvdRadio.IsPlaying && !PvdRadio.IsStopped)
                cmd4.Text = "Выключить радио";
            else
                cmd4.Text = "Запустить радио";
        }
    }
}
